package models

//作业05_封装一个函数，功能为交换两个1数字s
func swap(a interface{}, b interface{}) {
	a, b = b, a
}

//字符串交换参数
func swapbystring(a string, b string) {
	var as = &a
	var bs = &b
	var temp string
	temp = *as
	*as = *bs
	*bs = temp
}

//数字交换参数
func swapbyint(a int, b int) {
	var as = &a
	var bs = &b
	var temp int
	temp = *as
	*as = *bs
	*bs = temp
}

//浮点数交换参数
func swapbyfloat64(a float64, b float64) {
	var as = &a
	var bs = &b
	var temp float64
	temp = *as
	*as = *bs
	*bs = temp
}
